<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加</title>
</head>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/kindeditor-min.js"></script>
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/lang/zh_CN.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/jquery.pack.js" /></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/util.js" /></script>

<script language="javascript" type="text/javascript">
var editor;
KindEditor.ready(function(K) {
        editor = K.create('#content', {
		uploadJson : '<?php echo $this->url ($this->baseUrl, "editor", "upload", "", "admin");?>',
		fileManagerJson : '<?php echo $this->url ($this->baseUrl, "editor", "filemanage", "", "admin");?>',
		allowFileManager : true,
		urlType:"domain"
        });
        
        var d = new Date();
        var today = d.getFullYear() + "-" +(d.getMonth()+1)+"-"+d.getDate();
        var oldv = document.getElementById('pubtime').value;
        if (oldv.length < 5)
        	document.getElementById('pubtime').value = today;
});
</script>
<body>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" action="<?php echo $this->url ($this->baseUrl, "news", "doadd", "", "admin");?>">
<input type="hidden" name="cid" value="<?php echo $this->cid;?>" />
<input type="hidden" name="nowp" value="<?php echo $this->nowp;?>" />
<input type="hidden" name="aid" value="<?php echo $this->aid;?>" />
  <table width="100%" border="1" class="tableA" >
    <tr>
      <td colspan="3" align="center"><?php echo $this->title;?></td>
    </tr>
<?php
if ($this->sync):
?>
    <tr>
      <td width="14%">同步设置</td>
      <td width="50%">      
      <input id="sync_cb" name="sync_cb"  type="checkbox" value="1" /><label for="sync_cb">同步到发展研究院 新闻与热点</label></td>
      <td width="36%">&nbsp;</td>
    </tr>
<?php
endif;
?>
<?php
if (isset($this->arr_type)):
?>
    <tr>
      <td width="14%">选择分类</td>
      <td width="50%">
      <select name="typename" id="typename">
      <?php foreach ($this->arr_type as $v){
      	if (isset($this->content['typename']) && $this->content['typename'] == $v['name'])
      		echo "<option value='" . $v['name'] . "' selected='selected'>" . $v['name'] . "</option>";
      	else 
      		echo "<option value='" . $v['name'] . "'>" . $v['name'] . "</option>";
      }
      ?>
      </select></td>
</td>
      <td width="36%">&nbsp;</td>
    </tr>
<?php
endif;
?>
    <tr>
      <td>标题</td>
      <td><label for="title"></label>
      <input name="title" type="text" id="title" size="50" value="<?php secho($this->data, "title");?>" /></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>副标题</td>
      <td>
      <input name="subtitle" type="text" id="subtitle" size="50" value="<?php secho($this->data, "subtitle");?>" /></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>作者</td>
      <td><input name="author" type="text" id="author" size="30" value="<?php secho($this->data, "author");?>"/></td>
      <td>&nbsp;</td>
    </tr>
        <tr>
      <td>来源</td>
      <td><input name="afrom" type="text" id="afrom" size="30" value="<?php secho($this->data, "afrom");?>" /></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>关键词</td>
      <td><input name="keywords" type="text" id="keywords" size="30" value="<?php secho($this->data, "keywords");?>"/></td>
      <td>搜索关键词，多个关键词用逗号分隔</td>
    </tr>
    <?php if ($this->image):?>
    <tr>
      <td>图片</td>
      <td><input name="image" type="file" id="image" size="30" onchange="javascript:return fileExtCheck(this, ['jpg', 'png', 'gif']);" />
      <?php if (!empty($this->content['image'])) echo '<input type="checkbox" value="1" name="delimage" />删除图片<a href="' . $this->baseUrl . $this->content['image'] . '" target=_blank><img title="点击查看大图" border=0 height=30 width=30 src="' . $this->baseUrl . $this->content['image'] . '"></a>'?>
      </td>
      <td>新闻的图片<?php if (!empty($this->imageintro)){echo " " .$this->imageintro;}?></td>
    </tr>
    <?php endif;?>
    <?php if ($this->recommend):?>
    <tr>
      <td>是否推荐</td>
      <td><input id="recommend" name="recommend"  type="checkbox" value="1" <?php if (!empty($this->content['recommend'])){?>checked="checked"<?php } ?> /><label for="recommend">推荐</label></td>
      <td>推荐到首页显示</td>
    </tr>
    <?php endif;?>
    <tr>
      <td nowrap="nowrap">发布时间</td>
      <td><input name="pubtime" type="text" id="pubtime" size="30" value="<?php secho($this->data, "pubtime");?>" /></td>
      <td>发布时间</td>
    </tr>
    <tr>
      <td>排序</td>
      <td><input name="seq" type="text" id="seq" size="10" value="<?php secho($this->data, "seq", 100);?>" />&nbsp;<label for="top">置顶</label><input id="top" type="checkbox" value="1" name="top" /></td>
      <td>从大到小排序</td>
    </tr>
    <tr>
      <td>pdf内容</td>
      <td><input name="pdf" type="file" id="pdf" size="30" onchange="javascript:return fileExtCheck(this, ['pdf']);" />
      <?php if (!empty($this->content['pdf'])) echo '<input type="checkbox" value="1" name="delpdf" />删除PDF<a href="' . $this->baseUrl . $this->content['pdf'] . '" target=_blank>查看PDF</a>'?>
      <input id="btnpdf" name="btnpdf"  type="checkbox" value="1" <?php if (!empty($this->content['btnpdf'])){?>checked="checked"<?php } ?>/><label for="btnpdf">显示PDF下载按钮</label></td>
      <td>如果上传了PDF，则内容显示pdf </td>
    </tr>
    <?php if ($this->intro):?>
    <tr>
      <td>简介</td>
      <td colspan="2">
      <textarea name="intro" id="intro" cols="80" rows="20" style="width:700px;height:50px;"><?php secho($this->data, "intro");?></textarea></td>
    </tr>
    <?php endif;?>
    <tr>
      <td>内容</td>
      <td colspan="2">
      <textarea name="content" id="content" cols="80" rows="20" style="width:700px;height:400px;"><?php secho($this->data, "content");?></textarea></td>
    </tr>
    <tr>
      <td colspan="3" align="center"><input type="submit" name="button" id="button" value="提交" class="btn_submit"/></td>
    </tr>
  </table>
</form>
</body>
</html>